package com.flame.application.controller;

import com.flame.application.service.ChatService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Flux;

/**
 * @author Jflame
 * @version 1.0.0
 * @since 2025/8/15
 */
@RestController
public class ChatController {

    private final ChatService chatService;

    public ChatController(ChatService chatService) {
        this.chatService = chatService;
    }
    @GetMapping("/chat")
    public Flux<String> chat(@RequestParam("message") String message,@RequestParam(value = "conversation_id", required = false) String conversationId) {
        return chatService.chat(message, conversationId);
    }
}
